local skill = fk.CreateSkill {
  name = "#ling__double_swords_skill",
  attached_equip = "ling__double_swords",
}

Fk:loadTranslationTable{
  ["#ling__double_swords_skill"] = "干将莫邪",
  ["#ling__double_swords-invoke"] = "干将莫邪：弃置一张牌，否则 %src 摸一张牌",
}

skill:addEffect(fk.TargetSpecified, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skill.name) and
      data.card and data.card.trueName == "slash" and
      (data.to.hp == 4 or data.to.hp == 1)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:broadcastPlaySound("./packages/standard_cards/audio/card/double_swords")
    room:setEmotion(player, "./packages/standard_cards/image/anim/double_swords")
    if data.to:isNude() or
      #room:askToDiscard(data.to, {
        min_num = 1,
        max_num = 1,
        include_equip = true,
        skill_name = skill.name,
        cancelable = true,
        prompt = "#ling__double_swords-invoke:"..player.id,
      }) == 0 then
      player:drawCards(1, skill.name)
    end
  end,
})

return skill
